package com.ning.weixin.dao;

import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

/**
 * @author MENG_LI_DONG
 * @version 2018年12月21日 下午11:06:40
 */
@Component
public class AcInfoDao {
	private Logger log = LoggerFactory.getLogger(AcInfoDao.class);
	@Autowired
	private JdbcTemplate jdbcTemplate;
	public boolean isExpire(Long id){
		String sql = "select count(id) from ac_info t where t.start_time<=? and t.end_time>=?";
		log.debug("sql:"+sql);
		Date date = new Date();
		int count = jdbcTemplate.queryForObject(sql, new Object[]{date,date}, Integer.class);
		return count==0;
	}
}
